package com.wyx.controller;


import com.wyx.entity.Laboratory;
import com.wyx.service.LaboratoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王云翔
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/laboratory")
public class LaboratoryController {
    @Autowired
    private LaboratoryService laboratoryService;
    @GetMapping("/select")
    public List<Laboratory> selectAll(){
        return laboratoryService.list();
    }

    @PutMapping("/insert")
    public void insert(Laboratory laboratory){
        laboratoryService.save(laboratory);
    }
}

